#include <stdio.h>

int main(int argc, char const *argv[])
{
    int a = 24;
    int b = 18;
    int c = 0;
    for(int i=0;(a%b)!=0;i++){
        c = a%b;
        a = b;
        b = c;
    }
    printf("%d",c);
    return 0;
}
